// greater example
#include <iostream>         //std::cout
#include <functional>        //std::greater
#include <algorithm>        //std::sort

#include <queue>
#include <vector>
using namespace std;
int main(){
    int numbers[] = {20,40,50,10,30};
    std::sort(numbers,numbers+5,std::greater<int>());
    for(int i = 0;i< 5;i++)
        std::cout << numbers[i]<< ' ';
    std::cout << '\n';

    priority_queue<int,vector<int>,greater<int>> myQueue;

    myQueue.push(3);
    myQueue.push(4);
    myQueue.push(2);
    myQueue.push(1);
    while(!myQueue.empty()){
        cout << myQueue.top() << " ";
        myQueue.pop();
    }
    return 0;
}